#ifndef _ACCEPTOR_H_
#define _ACCEPTOR_H_
#include"socket.hh"
#include"InetAddr.hh"
#include"TcpConnection.hh"
#include<sys/socket.h>
#include<sys/types.h>
#include<vector>
#include<map>
#include<memory>



class Acceptor
{
public:
    Acceptor(const char *ip, int port);
    ~Acceptor();
    void ready();
private:
    void setreuseport();
    void setreuseip();
    void bind();
    void listen();
public:
    int accept();
    int fd();

private:
    Socket _socket;
    InetAddr _addr;

};
#endif
